#!/bin/echo Warning: this library should be sourced!

set -ue

if [ "$GERRIT_BRANCH" == "next" ]; then
    MANIFEST='EulerOS_next.xml'
    REPODIR='next'
elif [ "$GERRIT_BRANCH" == "RTOS_V2R1_ecos" ]; then
    MANIFEST='RTOS_V200R001C00_post.tr5.ecos.all.xml'
    REPODIR='ecos_RTOS_V200R001C00_post.tr5'
elif [ "$GERRIT_BRANCH" == "hyperstack-v1r5" ]; then
    MANIFEST='hyperstack-v1r5.xml'
    REPODIR='hyperstack-v1r5'
elif [ "$GERRIT_BRANCH" == "next_centos7.5" ]; then
    MANIFEST='EulerOS_next_centos7.5.xml'
    REPODIR='EulerOS_next_centos7.5'
elif [ "$GERRIT_BRANCH" == "next_centos7.5_uk" ]; then
    MANIFEST='EulerOS_next_centos7.5_uk.xml'
    REPODIR='EulerOS_next_centos7.5_uk'
fi

set +u
if [ "x${team_from_jenkins}" != "x" ]; then
    if [ "x${team_from_jenkins_open}" == "xopen_euler" ]; then
        MANIFEST="EulerOS_${team_from_jenkins_open}.xml"
        REPODIR='open_euler'
    elif [ "x${team_from_jenkins_unite}" == "xnext_unite" ]; then
        MANIFEST="EulerOS_${team_from_jenkins_unite}.xml"
        REPODIR='next'
    else
        MANIFEST="EulerOS_next_${team_from_jenkins}.xml"
        REPODIR='next'
    fi
fi

